﻿using System.Linq;
using MartinRL.ProjectEuler.Sequences;

namespace MartinRL.ProjectEuler
{
    /// <summary>
    /// http://projecteuler.net/index.php?section=problems&id=17
    /// </summary>
    public static class Problem017
    {
        public static int FindTheNumberOfLettersOf1To1000AsWords()
        {
            return 1.To(1000)
                .Select(t => t.AsWord())
                .JoinAsString()
                .RemoveAll(" ")
                .Count();
        }
    }
}